#ifndef ENVCARD_H
#define ENVCARD_H

#include <QFrame>
#include <QLabel>
#include <QLocale>

class EnvCard : public QFrame
{
    Q_OBJECT
public:
    explicit EnvCard(const QString &title, const QString &unit, QWidget *parent = nullptr);

    void setValue(double value);
    void setValueText(const QString &text);
    void setColor(const QColor &color);
    void setClickable(bool clickable);

signals:
    void clicked();

protected:
    void mousePressEvent(QMouseEvent *event) override;
    void enterEvent(QEvent *event) override;
    void leaveEvent(QEvent *event) override;

private:
    void setupUI();

    QLabel *titleLabel;
    QLabel *valueLabel;
    QLabel *unitLabel;
    bool isClickable = true;
};

#endif // ENVCARD_H
